package cn.glenn._08security.service;

import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

public class UserDetailServiceImpl implements UserDetailsService {
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {

        return User
                .withUsername("user")
                .password("{noop}123456")//{noop}代表使用明文，从数据获取
                .authorities("sys:private:edit")//权限：从数据库获取
                .build();
    }
}
